home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / text / edit / EdgeTexScripts.lha / view.edge < prev    next >
Encoding:
Text File  |  1994-08-27  |  1006 b   |  37 lines

  1. /*View Current*/
  2. options results
  3. getenvvar _FE_Name
  4. na=result
  5. ch = upper(right(na,4))
  6. if compare(ch,'.TEX') == 0 then name = left(na,length(na)-4)
  7.    else name=na
  8. getenvvar _FE_Path
  9. path=result
  10. file=path||name||'.dvi'
  11. getenvvar _FE_Changes
  12. number=result
  13. if ~(number==0) then do
  14.    rx stop sync 'rexx/autotex.edge'
  15.   end
  16. else do
  17.    if exists(file) then do
  18.       r=lastpos(file,"/")
  19.       lo=left(file,r)
  20.       log=lo||'showdvi.log'
  21.       address command 'TeX:bin/showdvi' file
  22.       if ~(rc==0) then do
  23.          changewindow leftedge 0 topedge 13 width 668 height 220
  24.          requestnotify title ERROR string 'View Failed.  See log.'
  25.          new
  26.          address value result
  27.          activatewindow port result
  28.          open files log
  29.          window front
  30.          changewindow leftedge 0 topedge 233 width 668 height 230
  31.         end
  32.       else address command delete log
  33.    end
  34. /*else requestnotify title ERROR string file' does not exist, TeX it first.'*/
  35.    else rx stop sync 'rexx/autotex.edge'
  36. end
  37.